using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
namespace MicroMsg.UI.UserContrl
{
	public class VoiceLangItem : UserControl
	{
		public delegate void ListItemClick(object sender, string langName, string langCode);
		private string languageName;
		private string zoneCode;
		private string isoCode;
		internal Button btnLayoutRoot;
		internal Grid LayoutRoot;
		internal StackPanel panelContent;
		internal TextBlock txtLangName;
		private bool _contentLoaded;
		public event VoiceLangItem.ListItemClick ItemClick;
		public VoiceLangItem(string lang)
		{
			this.InitializeComponent();
			this.initLangInfo(lang);
			this.txtLangName.set_Text(this.zoneCode);
		}
		private void initLangInfo(string lang)
		{
			if (string.IsNullOrEmpty(lang))
			{
				return;
			}
			string[] array = lang.Split(new char[]
			{
				':'
			});
			if (array != null && array.Length >= 3)
			{
				this.languageName = array[0];
				this.zoneCode = array[1];
				this.isoCode = array[2];
				return;
			}
		}
		private void btnLayoutRoot_Click(object sender, RoutedEventArgs e)
		{
			if (this.ItemClick != null)
			{
				this.ItemClick(this, this.languageName, this.zoneCode);
			}
		}
		[DebuggerNonUserCode]
		public void InitializeComponent()
		{
			if (this._contentLoaded)
			{
				return;
			}
			this._contentLoaded = true;
			Application.LoadComponent(this, new Uri("/MicroMsg;component/Source/UI/CommonUseControl/VoiceLangItem.xaml", 2));
			this.btnLayoutRoot = (Button)base.FindName("btnLayoutRoot");
			this.LayoutRoot = (Grid)base.FindName("LayoutRoot");
			this.panelContent = (StackPanel)base.FindName("panelContent");
			this.txtLangName = (TextBlock)base.FindName("txtLangName");
		}
	}
}
